package com.haonan.springboot_exercise.service;


import com.haonan.springboot_exercise.bean.pojo.MsgResult;
import com.haonan.springboot_exercise.bean.pojo.MyMailMessage;
import com.haonan.springboot_exercise.bean.pojo.ReadableMail;
import com.haonan.springboot_exercise.bean.pojo.Result;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author haonan
 */
@Service
public interface MailService {
    /**
     * 发送邮件
     * @param myMailMessage 前端传入的邮件类（to是String[]）
     * @return MsgResult状态码
     * @throws Exception
     */
    MsgResult sendMyMail(MyMailMessage myMailMessage) throws Exception;

    /**
     * 进入收件箱
     * @param username 用户名
     * @return （前端）可读邮件的集合
     * @throws InterruptedException
     */
    List<ReadableMail> getInbox(@Param("username") String username) throws InterruptedException;

    /**
     * 通过email_id集合删除对应的邮件
     * @param emailIdList email_id集合
     * @return Result
     */
    Result deleteEmail(List<Integer> emailIdList);

    /**
     * 进入发件箱
     * @param user_name 用户名
     * @return （前端可读邮件的集合）
     * @throws InterruptedException
     */
    List<ReadableMail> getOutbox(@Param("username") String user_name) throws InterruptedException;
}
